package com.java.business.controller;

import com.java.business.model.WorkInfo;
import com.java.business.service.WorkInfoService;
import com.java.common.model.Result;
import com.java.userservice.model.Permission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/workInfo")
public class WorkInfoController {

    @Autowired
    private WorkInfoService workInfoService;

    @PostMapping("/list")
    public Result list(@RequestBody WorkInfo workInfo) {
        return workInfoService.list(workInfo);
    }

    @PostMapping("/save")
    public Result save(@RequestBody WorkInfo workInfo) {
        return workInfoService.save(workInfo);
    }

    @PostMapping("/modify")
    public Result modify(@RequestBody WorkInfo workInfo) {
        return workInfoService.modify(workInfo);
    }

    @PostMapping("/remove")
    public Result remove(@RequestBody int[] ids) {
        return workInfoService.remove(ids);
    }

    @PostMapping("/repair")
    public Result repair(@RequestBody WorkInfo workInfo) {
        return workInfoService.modify(workInfo);
    }

}
